// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using System;
using System.Linq;
using Elastic.Clients.Elasticsearch.Serialization;

namespace Elastic.Clients.Elasticsearch.Analysis;

[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.IcuCollationTokenFilterConverter))]
public sealed partial class IcuCollationTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter
{
#if NET7_0_OR_GREATER
	public IcuCollationTokenFilter()
	{
	}
#endif
#if !NET7_0_OR_GREATER
	public IcuCollationTokenFilter()
	{
	}
#endif
	[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
	internal IcuCollationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel)
	{
		_ = sentinel;
	}

	public Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate? Alternate { get; set; }
	public Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst? CaseFirst { get; set; }
	public bool? CaseLevel { get; set; }
	public string? Country { get; set; }
	public Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition? Decomposition { get; set; }
	public bool? HiraganaQuaternaryMode { get; set; }
	public string? Language { get; set; }
	public bool? Numeric { get; set; }
	public string? Rules { get; set; }
	public Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength? Strength { get; set; }

	public string Type => "icu_collation";

	public string? VariableTop { get; set; }
	public string? Variant { get; set; }
	public string? Version { get; set; }
}

public readonly partial struct IcuCollationTokenFilterDescriptor
{
	internal Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilter Instance { get; init; }

	[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
	public IcuCollationTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilter instance)
	{
		Instance = instance;
	}

	[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
	public IcuCollationTokenFilterDescriptor()
	{
		Instance = new Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance);
	}

	public static explicit operator Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilterDescriptor(instance);
	public static implicit operator Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilter(Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilterDescriptor descriptor) => descriptor.Instance;

	public Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilterDescriptor Alternate(Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate? value)
	{
		Instance.Alternate = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilterDescriptor CaseFirst(Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst? value)
	{
		Instance.CaseFirst = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilterDescriptor CaseLevel(bool? value = true)
	{
		Instance.CaseLevel = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilterDescriptor Country(string? value)
	{
		Instance.Country = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilterDescriptor Decomposition(Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition? value)
	{
		Instance.Decomposition = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilterDescriptor HiraganaQuaternaryMode(bool? value = true)
	{
		Instance.HiraganaQuaternaryMode = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilterDescriptor Language(string? value)
	{
		Instance.Language = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilterDescriptor Numeric(bool? value = true)
	{
		Instance.Numeric = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilterDescriptor Rules(string? value)
	{
		Instance.Rules = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilterDescriptor Strength(Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength? value)
	{
		Instance.Strength = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilterDescriptor VariableTop(string? value)
	{
		Instance.VariableTop = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilterDescriptor Variant(string? value)
	{
		Instance.Variant = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilterDescriptor Version(string? value)
	{
		Instance.Version = value;
		return this;
	}

	[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
	internal static Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilter Build(System.Action<Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilterDescriptor>? action)
	{
		if (action is null)
		{
			return new Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance);
		}

		var builder = new Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilterDescriptor(new Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance));
		action.Invoke(builder);
		return builder.Instance;
	}
}